// @/device.js
import request from '@/utils/request'

// 获取设备列表
export function getDeviceList(data) {
  return request({
    url: '/device.php',
    method: 'post',
    data
  })
}

// 添加设备
export function addDevice(data) {
  return request({
    url: '/device.php',
    method: 'post',
    data
  })
}

// 删除设备
export function deleteDevice(data) {
  return request({
    url: '/device.php',
    method: 'post',
    data
  })
}

// 添加分组
export function addGroup(data) {
  return request({
    url: '/device.php',
    method: 'post',
    data
  })
}

// 删除分组
export function deleteGroup(groupId) {
  return request({
    url: '/device.php?action=deleteGroup',
    method: 'post',
    data: { id: groupId }
  })
}

// 移动设备到分组
export function moveDeviceToGroup(data) {
  return request({
    url: '/device.php',
    method: 'post',
    data
  })
}

// 批量操作
export function batchOperation(data) {
  return request({
    url: '/device.php',
    method: 'post',
    data
  })
}